package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMtnChannelRouteElementsMapper;
import com.ruoyi.net.domain.BusiMtnChannelRouteElements;
import com.ruoyi.net.service.IBusiMtnChannelRouteElementsService;

/**
 * 业务-MTN Channel路由图Service业务层处理
 * 
 * @author tony
 * @date 2024-12-08
 */
@Service
public class BusiMtnChannelRouteElementsServiceImpl implements IBusiMtnChannelRouteElementsService 
{
    @Autowired
    private BusiMtnChannelRouteElementsMapper busiMtnChannelRouteElementsMapper;

    /**
     * 查询业务-MTN Channel路由图
     * 
     * @param id 业务-MTN Channel路由图主键
     * @return 业务-MTN Channel路由图
     */
    @Override
    public BusiMtnChannelRouteElements selectBusiMtnChannelRouteElementsById(String id)
    {
        return busiMtnChannelRouteElementsMapper.selectBusiMtnChannelRouteElementsById(id);
    }

    /**
     * 查询业务-MTN Channel路由图列表
     * 
     * @param busiMtnChannelRouteElements 业务-MTN Channel路由图
     * @return 业务-MTN Channel路由图
     */
    @Override
    public List<BusiMtnChannelRouteElements> selectBusiMtnChannelRouteElementsList(BusiMtnChannelRouteElements busiMtnChannelRouteElements)
    {
        return busiMtnChannelRouteElementsMapper.selectBusiMtnChannelRouteElementsList(busiMtnChannelRouteElements);
    }

    /**
     * 新增业务-MTN Channel路由图
     * 
     * @param busiMtnChannelRouteElements 业务-MTN Channel路由图
     * @return 结果
     */
    @Override
    public int insertBusiMtnChannelRouteElements(BusiMtnChannelRouteElements busiMtnChannelRouteElements)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMtnChannelRouteElements.getId())) {
            busiMtnChannelRouteElements.setId(uuid);
        }
        busiMtnChannelRouteElements.setCreateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteElements.setCreateTime(DateUtils.getNowDate());
        busiMtnChannelRouteElements.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteElements.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteElementsMapper.insertBusiMtnChannelRouteElements(busiMtnChannelRouteElements);
    }

    /**
     * 修改业务-MTN Channel路由图
     * 
     * @param busiMtnChannelRouteElements 业务-MTN Channel路由图
     * @return 结果
     */
    @Override
    public int updateBusiMtnChannelRouteElements(BusiMtnChannelRouteElements busiMtnChannelRouteElements)
    {
        busiMtnChannelRouteElements.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteElements.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteElementsMapper.updateBusiMtnChannelRouteElements(busiMtnChannelRouteElements);
    }

    /**
     * 批量删除业务-MTN Channel路由图
     * 
     * @param ids 需要删除的业务-MTN Channel路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteElementsByIds(String[] ids)
    {
        return busiMtnChannelRouteElementsMapper.deleteBusiMtnChannelRouteElementsByIds(ids);
    }

    /**
     * 删除业务-MTN Channel路由图信息
     * 
     * @param id 业务-MTN Channel路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteElementsById(String id)
    {
        return busiMtnChannelRouteElementsMapper.deleteBusiMtnChannelRouteElementsById(id);
    }
}
